<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>$Title$</title>
    <link href="./css/normalize.css" rel="stylesheet">
    <link href="./css/bootstrap.css" rel="stylesheet">
    <script src="./js/jquery/jquery.js"></script>
    <script src="./js/bootstarp/bootstrap.js"></script>
    <!--3.验证规则样式-->
    <link href="./css/bootstrapValidator.css" rel="stylesheet">
    <!--4.核心验证文件-->
    <script src="./js/bootstarp/bootstrapValidator.js"></script>
    <!--5.中文校验-->
    <script src="./js/language/zh_CN.js"></script>
    <script src="./js/utils/constants.js"></script>
    <script>
        $(function () {
            $("#subBtn").click(function () {
                let cate={
                    name:$("#cateName").val(),
                    parentId:$("#parentId").val(),
                    imgUri:$("#imgUrl").val(),
                    keyword:$("#keyword").val(),
                    description:$("#description").val(),
                    sort:$("#sor").val()

                }
                $.ajax({
                    url: CATE_ADD_URL,
                    type:"POST",
                    data: {
                        category:JSON.stringify(cate),
                    },
                    success(res)
                    {
                        console.log(res)
                    },
                    error(res)
                    {
                        console.log(res)
                    }
                })
            })
        })
    </script>
</head>
<body>
<div class="container">
    <!--留空-->
    <div class="row navbar-form"></div>
    <!--表单-->
    <form class="form-horizontal">

        <div class="form-group">
            <label for="cateName" class="col-sm-2 control-label">分类名</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="cateName" placeholder="请输入分类名">
            </div>
        </div>
        <div class="form-group">
            <label for="parentId" class="col-sm-2 control-label">父类Id</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="parentId" placeholder="父类Id">
            </div>
        </div>
        <div class="form-group">
            <label for="imgUrl" class="col-sm-2 control-label">选择图片</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="imgUrl">
            </div>
        </div>
        <div class="form-group">
            <label for="keyword" class="col-sm-2 control-label">搜索关键词</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="keyword" placeholder="请输入搜索关键词">
            </div>
        </div>
        <div class="form-group">
            <label for="description" class="col-sm-2 control-label">描述</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="description" placeholder="请输入商品描述">
            </div>
        </div>
        <div class="form-group">
            <label for="sor" class="col-sm-2 control-label">排序</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="sor" placeholder="请输入排序，数值越小越靠前">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" id="subBtn" class="btn btn-default center-block">确认提交</button>
            </div>
        </div>
    </form>
</div>
</body>
</html>